package com.hand.hzero.api.controller.v1;

import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.hzero.boot.message.MessageClient;
import org.hzero.boot.message.entity.Message;
import org.hzero.boot.message.entity.Receiver;
import org.hzero.core.util.Results;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @author hand-wd
 */
public class EmailController {
//    @Resource
//    private MessageClient messageClient;
//
//    public ResponseEntity<List<Receiver>> getReceiverList() {
//        long tenantId = 0L;
//        // 接受组配置密码
//        String receiverGroupCode = "QIAO_JIA_JIN";
//        // 消息模板参数
//        Map<String, String> args = new HashMap<>(2);
//        args.put("x", "x");
//        List<Receiver> receiver = messageClient.receiver(tenantId, receiverGroupCode, args);
//        return Results.success(receiver);
//    }
//
//
//    // 发送站内消息
//    @ApiOperation(value = "批量获取编码规则值")
//    @Permission(permissionLogin = true)
//    @PostMapping("/send-email")
//    public ResponseEntity<Message> sendEmail() {
//        long tenantId = 0L;
//        // 消息模板编码
//        String messageTemplateCode = "QIAO_JIA_JIN";
//        // 接收组配置编码
//        String receiverGroupCode = "QIAO_JIA_JIN";
//        // 消息模板参数
//        Map<String, String> args = new HashMap<>(2);
//        args.put("param", "123456");
//        Message message = messageClient.sendWebMessage(tenantId, messageTemplateCode, receiverGroupCode, args);
//        return Results.success(message);
//    }
}
